package com.castle.fortress.admin.study.exam.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.castle.fortress.admin.study.exam.entity.StudyQuestionEntity;
import com.castle.fortress.admin.study.exam.dto.StudyQuestionDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.castle.fortress.common.entity.RespBody;

import java.util.Map;
import java.util.List;

/**
 * 题目 服务类
 *
 * @author castle
 * @since 2023-02-10
 */
public interface StudyQuestionService extends IService<StudyQuestionEntity> {

    /**
     * 分页展示题目列表
     * @param page
     * @param studyQuestionDto
     * @return
     */
    IPage<StudyQuestionDto> pageStudyQuestion(Page<StudyQuestionDto> page, StudyQuestionDto studyQuestionDto);

    /**
    * 分页展示题目扩展列表
    * @param page
    * @param studyQuestionDto
    * @return
    */
    IPage<StudyQuestionDto> pageStudyQuestionExtends(Page<StudyQuestionDto> page, StudyQuestionDto studyQuestionDto);
    /**
    * 题目扩展详情
    * @param id 题目id
    * @return
    */
    StudyQuestionDto getByIdExtends(Long id);

    /**
     * 展示题目列表
     * @param studyQuestionDto
     * @return
     */
    List<StudyQuestionDto> listStudyQuestion(StudyQuestionDto studyQuestionDto);

    /**
     * 调整题目顺序
     * @param id
     * @param sort
     * @return
     */
    boolean updateStudyQuestionSort(Long id, Integer sort);

    /**
     * 校验同题库下题目重名
     * @param studyQuestionEntity
     * @return
     */
    boolean checkName(StudyQuestionEntity studyQuestionEntity);

    /**
     * 批量导入
     * @param url
     * @param qbId
     * @return
     */
    RespBody<String> importQuestions(String url, Long qbId);
}
